<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<jsp:include page="/WEB-INF/jsp/include/incEasyUI_1.4.2.jsp"></jsp:include>

<link href="${pageContext.request.contextPath}/js/util/filter/filter.css" rel="stylesheet" type="text/css"/> 
<script type="text/javascript" src="${pageContext.request.contextPath}/js/util/filter/filter.js" charset="utf-8"></script>



<script type="text/javascript">
	$.canDetail = true;
	$.canDelete = true;
	$.canAdd= true;

	var objectName="${objectName}";
	console.log(objectName);
</script>

<%--
<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/projectDetail')}">
	<script type="text/javascript">
		console.log("canEdit");
		$.canDetail = true;
	</script>
</c:if>

<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/deleteProject')}">
	<script type="text/javascript">
		$.canDelete = true;
		//console.log("can delete");
	</script>
</c:if>
<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/addProject')}">
	<script type="text/javascript">
		$.canAdd= true;
	</script>
</c:if> 
--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/mapping/module/common/dataGrid/${objectName}Json.js" charset="utf-8"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/mapping/module/common/dataGrid/dataGrid.js" charset="utf-8"></script>
</head>
<body>
<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',title:'查询条件',border:false" style="height: 180px;">
			<div id="crumbId1"></div>
			<div id="filter_group"></div>
		</div>
		<div data-options="region:'center',border:true">
			
			<table id="dataGrid"></table>
		</div>
	</div>
	<div id="toolbar" style="display: none;">
		搜索项目：
		<select id="project-field">
			  <option value ="sn.snInt" selected>设计编号</option>
			  <option value ="project.name">项目名称</option>
		</select>&nbsp;&nbsp;：
		<input type="text" value="" id="project-field-value">
		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_add',plain:true" onclick="datagridQuery();">搜索</a>
		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_delete',plain:true" onclick="removeSearch();">清空搜索</a>

		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_add',plain:true" onclick="addNewProjectTab();">添加项目</a>

		<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_delete',plain:true" onclick="batchDeleteFun();">

		<%-- <c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/addProject')}">
			<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_add',plain:true" onclick="addNewProjectTab();">添加项目</a>
		</c:if>
		<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/deleteProject')}">
			<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'brick_delete',plain:true" onclick="batchDeleteFun();">删除勾选</a>
		</c:if> --%>
		<a href="javascript:void(0)" id="mb" class="easyui-menubutton"  data-options="menu:'#mm1',iconCls:'book_next'">导出Excel</a>   
			<div id="mm1" style="width:150px;">   
			    <div data-options="iconCls:'icon-undo'" onclick="downloadFiltered('excel');" >导出筛选</div>
			    <div class="menu-sep"></div>   
			    <div data-options="iconCls:'icon-redo'" onclick="downloadChecked('excel');">导出勾选</div>  
			    <div class="menu-sep"></div> 
			    <div data-options="iconCls:'icon-redo'" onclick="downloadAll('excel');">导出全部</div>   
			</div> 
		<a href="javascript:void(0)" id="mb" class="easyui-menubutton"  data-options="menu:'#mm2',iconCls:'book_next'">导出Docx</a>   
			<div id="mm2" style="width:150px;">   
			    <div data-options="iconCls:'icon-undo'" onclick="downloadFiltered('docx');" >导出筛选</div>
			     <div class="menu-sep"></div>   
			    <div data-options="iconCls:'icon-redo'" onclick="downloadChecked('docx');">导出勾选</div> 
			     <div class="menu-sep"></div>  
			    <div data-options="iconCls:'icon-redo'" onclick="downloadAll('docx');">导出全部</div>   
			</div> 
		<a href="javascript:void(0);" id='toggleCheckedFilterButton' class="easyui-linkbutton" data-options="iconCls:'brick_delete',plain:true,toggle:true" onclick="toggleCheckedFilter();">显示勾选</a>
		<a href="javascript:void(0)" id="mb" class="easyui-menubutton"  data-options="menu:'#mm3',iconCls:'book_next'">数据导入</a>   
			<div id="mm3" style="width:150px;">   
			    <div data-options="iconCls:'icon-undo'" onclick="downloadTemplate();">模板下载</div>
			     <div class="menu-sep"></div>   
			    <div data-options="iconCls:'icon-redo'" onclick="uploadExcel();">Excel数据导入</div> 
			</div> 
	</div>
	<iframe id="downloadframe" style="display:none"></iframe>
	<%--
	<div id="menu" class="easyui-menu" style="width: 120px; display: none;">
		<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/projectDetail')}">
		<div onclick="addProjectDetailTab();" data-options="iconCls:'pencil'">详情</div>
		</c:if>
		<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/addProject')}">
			<div onclick="addFun();" data-options="iconCls:'pencil_add'">增加</div>
		</c:if>
		<c:if test="${fn:contains(sessionInfo.resourceList, '/projectController/deleteProject')}">
			<div onclick="deleteFun();" data-options="iconCls:'pencil_delete'">删除</div>
		</c:if>
	</div>
	--%>
</body>
</html>